<%@ page language="java" contentType="text/html;charset=utf-8"
	pageEncoding="utf-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>CDSF</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <!-- Le styles -->
    <link href="<c:url value='/css/bootstrap.min.css'/>" rel="stylesheet">
    <style type="text/css">
      body {
        padding-top: 60px;
        padding-bottom: 40px;
      }
      .sidebar-nav {
        padding: 9px 0;
      }

      @media (max-width: 980px) {
        /* Enable use of floated navbar text */
        .navbar-text.pull-right {
          float: none;
          padding-left: 5px;
          padding-right: 5px;
        }
      }
    </style>
    <link href="<c:url value='/css/bootstrap-responsive.min.css'/>" rel="stylesheet">

    <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="//cdnjs.bootcss.com/ajax/libs/html5shiv/3.6.2/html5shiv.js"></script>
    <![endif]-->

    <!-- Fav and touch icons -->
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="../assets/ico/apple-touch-icon-144-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="../assets/ico/apple-touch-icon-114-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="../assets/ico/apple-touch-icon-72-precomposed.png">
                    <link rel="apple-touch-icon-precomposed" href="../assets/ico/apple-touch-icon-57-precomposed.png">
                                   <link rel="shortcut icon" href="../assets/ico/favicon.png">
  </head>

  <body>

      <div class="navbar navbar-inverse navbar-fixed-top">
      <div class="navbar-inner">
        <div class="container-fluid">
          <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="brand" href="#">CDSF</a>
          <div class="nav-collapse collapse">
            <p class="navbar-text pull-right">
              Logged in as <a href="#" class="navbar-link">Username</a>
            </p>
            <ul class="nav">
              <li class="active"><a href="#">Home</a></li>
              <li><a href="#about">About</a></li>
              <li><a href="#contact">Contact</a></li>
            </ul>
          </div><!--/.nav-collapse -->
        </div>
      </div>
    </div>

    <div class="container-fluid">
      <div class="row-fluid">
        <div class="span3">
          <div class="well sidebar-nav">
            <ul class="nav nav-list">
              <li class="nav-header">显控设计模式</li>
              <c:forEach items="${designPatternList}" var="dp">
              	<li ><a href="<%=request.getContextPath()%>/${dp.uri.replace(':','/')}"><c:out value="${dp.name}" /></a></li>
              </c:forEach>
            </ul>
          </div><!--/.well -->
        </div><!--/span-->
        <div class="span9">
			<div class="row-fluid">
				<div class="span9">
					<h2><c:out value="${designPattern.name}" /></h2>
				</div>
				<div class="span9">
					<table class="table table-bordered" >
						<thead>
							<tr>
								<th>属性</th>
								<th>描述</th>
							</tr>
						</thead>
						<tbody>
							<c:forEach items="${designPattern.getProperties()}" var="dpp" >
							<tr>
								<td><c:out value="${dpp.name}" /></td>
								<td><c:out value="${dpp.description}" /></td>
							</tr>
							</c:forEach>
						</tbody>
					</table>
				</div>
				<div class="span9">
					<strong><p>设计模式配置文件</p></strong>
					<code class="code">
						<pre>&lt;?xml version="1.0"?&gt;
&lt;design-pattern name="bus_design_pattern" &gt;
	&lt;design-pattern-label&gt;总线通信设计模式&lt;/design-pattern-label&gt;
	&lt;properties&gt;
		&lt;property name="bus_data_area"&gt;
			&lt;property-label&gt;总线数据区&lt;/property-label&gt;
			&lt;value-type type="map"&gt;
				&lt;key-dependency&gt;domain&lt;/key-dependency&gt;
				&lt;value-dependency&gt;domain&lt;/value-dependency&gt;
				&lt;key-label&gt;总线数据区&lt;/key-label&gt;
				&lt;value-label&gt;实体数据区&lt;/value-label&gt;
			&lt;/value-type&gt;
		&lt;/property&gt;
	&lt;/properties&gt;
&lt;/design-pattern&gt;
						</pre>
					</code>
				</div>
			</div>

        </div><!--/span-->
      </div><!--/row-->

      <hr>

      <footer>
        <p>&copy; SJTU 2013</p>
      </footer>

    </div><!--/.fluid-container-->

    <!-- Le javascript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="<c:url value='/js/jquery.min.js'/>"></script>
    <script src="<c:url value='/js/bootstrap.min.js'/>"></script>

  </body>
</html>
